<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">默认加油类型管理</li>
    </ol>
    
    <div class="ms-content-layout has-operation">
    
      <div class="ms-operation-bar no-margin no-bottom-border clearfix">
        <div class="ms-operation-group pull-right">
          <a href="${ctx.host}/default-oil-types/search" data-target="#" data-toggle="modal" class="btn ms-btn ms-btn-blue">
            <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
          </a>
        </div>
      </div>
    
      <table class="table table-hover ms-table">
	      <thead>
	        <tr>
            <th>公司名称</th>
            <th>默认油料类型</th>
            <th>操作</th>
          </tr>
	      </thead>
	      
        <tbody>
          <c:forEach items="${defaultOilTypes}" var="defaultOilType">
            <tr>
              <td>${persist.organization(defaultOilType.orgId).name}</td>
              <td>${defaultOilType.oilTypeId eq 3 ? '#0' : '-#10'}</td>
              <td>
               <a href="${ctx.host}/default-oil-types/${defaultOilType.orgId}/edit"  data-toggle="modal" data-target="#edit">修改默认油料类型</a>
              </td>
            </tr>
          </c:forEach>
        </tbody>
      </table>

    </div> 
  </div>       
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/data/cost/default-oil-type-list.js" />
  <script type="text/javascript">
      require(['page/data/cost/default-oil-type-list'], function(page) {
        page.init()
      })
  </script>
  
</body>
</html>